-
-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wxGUI: refactoring: Map Display inheriting from wx.Panel #1675
wxGUI: refactoring: Map Display inheriting from wx.Panel #1675
Conversation
Some testing:
|
gui/wxpython/lmgr/frame.py
Outdated
# show map display if requested | ||
if show: | ||
self.currentPage.mapdisplay.Show() | ||
self.currentPage.mapdisplay.Refresh() | ||
self.currentPage.mapdisplay.Update() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be probably moved back to layertree, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder what the Refresh and Update are for here, just wondering if it's even necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be probably moved back to layertree, no?
Or to CreateNewMapDisplay method? We do not need layertree to get to know the show parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder what the Refresh and Update are for here, just wondering if it's even necessary.
You're right.. not needed.
I corrected this stuff before those intense unsuccessful changes related to closing and then I somehow lost them :/ ... what to say , just sh*t happens |
Check FullScreen methods in MapPanelBase, probably should go to the mixin. |
Oh, you are right, we need also to check methods inherited from wx.TopLevelWindow |
What do you think about it now? Shall I move SetPosition, SetSize and SetIcon also to FrameMixin? |
gui/wxpython/gui_core/mapdisp.py
Outdated
def SetFocus(self): | ||
self.GetParent().SetFocus() | ||
|
||
def OnFullScreen(self, toolbars, auimgr, event): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be def ShowFullScreen(self, show)
to resemble the actual TopLevelWindow method and inside you would hide/show the toolbars and I think also statusbar. Method IsFullScreen should be defined outside of this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coded :-)
I don't think that's needed. |
I am not sure how to deal with DMonGrassInterface. I think after merging #1689, we could remove it. What do you think @petrasovaa? |
Why? I didn't review the latest changes, so I am probably missing something. |
We actually inherit from MapPanelBase because all these panels - d.mon, r.digit, v.vidit inherit from mapdisp/MapPanel . And methods dealing with toolbars and statusbar and probably all other methods left in DMonGrassInterface could be (after #1689) taken from the MapPanelBase class. |
Check changes to g.gui.iclass.py, this looks like a mistake. |
What I have also noticed when launching these four lines are shown: (wxgui.py:114279): Gtk-CRITICAL **: 10:46:16.811: gtk_widget_set_size_request: assertion 'width >= -1' failed (wxgui.py:114279): Gtk-CRITICAL **: 10:46:16.909: gtk_widget_set_size_request: assertion 'width >= -1' failed (wxgui.py:114279): Gtk-CRITICAL **: 10:46:16.909: gtk_widget_set_size_request: assertion 'width >= -1' failed (wxgui.py:114279): Gtk-CRITICAL **: 10:46:17.009: gtk_widget_set_size_request: assertion 'width >= -1' failed And they are then shown whenever I add a new mapdisplay. |
That's a pain and not easy to suppress or figure out what causes them. Are these new, i.e. caused by this PR? If yes, it may be worth finding out the gui component causing it. |
0a3a569
to
6250a0d
Compare
@petrasova I have scanned gui if there is any SingleMapFrame or DoubleMapFrame stuff remaining and I have found "SingleMapFrame" in doc/gui/wxpython/example.py.. shell I deal with that? |
Good catch, yes please look at it. |
@petrasovaa It looks like we did forget to change g.gui.mapswipe with the thing of removing StandaloneGrassInterface. Sorry, I have not noticed before, there were lots of files in #1729 ... I can address it here. What do you think? |
Actually both - mapswipe/frame.py as well as mapswipe/g.gui.mapswipe.py, if I look right. We can create another small PR for it as the correction of #1729. The same thing is needed for ExampleMapPanel where on the top of it we also forgot about statusbars - so we could merge these final touches to one smaller PR. |
…ng events need to correct)
…exist (checked by grep)
60ab28d
to
4e6847c
Compare
@petrasovaa I have tested it, and it looks good. I think it is ready to merge. |
Map Display GUI logic is being changed. For purposes of the Single-Window GUI, MapFrameBase was replaced by MapPanelBase. It subsequently influeced all GUI tools which had been build based on MapFrameBase. All these tools had to be adapted for new wx.Panel based solution.
Map Display GUI logic is being changed. For purposes of the Single-Window GUI, MapFrameBase was replaced by MapPanelBase. It subsequently influeced all GUI tools which had been build based on MapFrameBase. All these tools had to be adapted for new wx.Panel based solution.
Map Display GUI logic is being changed. For purposes of the Single-Window GUI, MapFrameBase was replaced by MapPanelBase. It subsequently influeced all GUI tools which had been build based on MapFrameBase. All these tools had to be adapted for new wx.Panel based solution.
Map Display GUI logic is being changed. For purposes of the Single-Window GUI, MapFrameBase was replaced by MapPanelBase. It subsequently influeced all GUI tools which had been build based on MapFrameBase.
All these tools had to be adapted for new wx.Panel based solution. It had to be coded at once so that's the reason why this PR is too long.
There is the list of influenced GUI tools: